Skip to content

style(request): simplify request config access - #793

Merged
0x676e67 merged 1 commit into
mainfrom
style
Jul 13, 2025
Merged

style(request): simplify request config access#793
0x676e67 merged 1 commit into
mainfrom
style

Conversation

@0x676e67

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies how request configuration is accessed by consolidating multiple specialized accessor methods into a single generic config_mut method and updating builder calls to use it.

  • Removed individual *_mut accessors in Request and added a generic config_mut<T>()
  • Refactored all RequestBuilder methods to call config_mut::<...>() instead of dedicated accessors
  • Cleaned up import statements, removing now-unneeded specific imports
Comments suppressed due to low confidence (5)

src/client/request.rs:18

  • The AcceptEncoding type returned by config_mut::<RequestAcceptEncoding>() is used in the builder methods but no longer imported. Add use super::layer::decoder::AcceptEncoding; so it resolves correctly.
use super::layer::config::RequestAcceptEncoding;

src/client/request.rs:292

  • RequestSkipDefaultHeaders is referenced here but not imported from core::ext. Add it to the use super::core::ext::{ ... } list so this call compiles.
            *req.config_mut::<RequestSkipDefaultHeaders>() = Some(skip);

src/client/request.rs:367

  • RequestTotalTimeout is missing from the core::ext imports. Include it so that config_mut::<RequestTotalTimeout>() can be resolved.
            *req.config_mut::<RequestTotalTimeout>() = Some(timeout);

src/client/request.rs:379

  • RequestReadTimeout isn’t imported in the core::ext block. Add this import so the config_mut call compiles.
            *req.config_mut::<RequestReadTimeout>() = Some(timeout);

src/client/request.rs:472

  • RequestRedirectPolicy is used here but not imported from core::ext. Add it to the import list to fix the unresolved reference.
            *req.config_mut::<RequestRedirectPolicy>() = Some(policy);

@0x676e67
0x676e67 merged commit 0f6f523 into main Jul 13, 2025
7 checks passed
@0x676e67
0x676e67 deleted the style branch July 13, 2025 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants